Dir[$] [ ( fileSpec [ , attributeMask ] ) ]
fileSpec
A string expression that specifies a path and the file names you want returned. The argument is required only for the first call to Dir$ for any path.
Standard wildcard characters can be used in fileSpec to designate all files satisfying the wildcard criterion. Asterisk ( * ) for either the file name or the extension designates all files with any characters in that position. Question mark ( ? ) in any character position in either part of the name designates any single character in that position.
attributeMask
An integer expression whose value specifies what names should be returned. If this argument is omitted, the names of normal files that match fileSpec are returned. If you supply an attributeMask argument, you must supply a fileSpec argument.
Dir$ always returns the names of normal files. To include other files in the returned list of file names, specify the sum of those values in the following table that correspond to the desired kinds of files:
Mask | File attribute | Constant |
0 | Normal file | ATTR_NORMAL |
2 | Hidden file | ATTR_HIDDEN |
4 | System file | ATTR_SYSTEM |
8 | Volume label | ATTR_VOLUME. If any other attribute is specified, ATTR_VOLUME is ignored. |
16 | Directory | ATTR_DIRECTORY |